﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Workflow.Model
{
	[Serializable]
	public class CaseEEM
	{
		public virtual long CaseNo { get; set; }

		public virtual string FileName { get; set; }

		public virtual string BatchNo { get; set; }

		//public virtual FolerClass ProcessType { get; set; }

		public virtual FolerClass FolderLevelA { get; set; }

		public virtual FolerClass FolderLevelB { get; set; }

		public virtual FolerClass CheckType { get; set; }

		public virtual string InvoiceNo { get; set; }

		public virtual WorkStatus WorkStatus { get; set; }

		public virtual string StatusComment { get; set; }
		public virtual CaseReason CommentCode { get; set; }

		public virtual DateTime? StatusDate { get; set; }

		public virtual DateTime? ReceiveDate { get; set; }
		

		/// <summary>
		/// 操作者
		/// </summary>
		public virtual User Operator { get; set; }

		/// <summary>
		/// 产生当前STATUS的人
		/// </summary>
		public virtual User StatusOperator { get; set; }


		public virtual CaseMapPropertyEEM CaseMapPropertyEEM { get; set; }

		/// <summary>
		/// 获取文件路径 如：/PTP/2Z/
		/// </summary>
		/// <returns></returns>
		public virtual string GetFolerPath()
		{
			var path = new StringBuilder();

			//path.Append("/" + ProcessType.FolderName);
            //path.Append("/" + "EEM");

            var arr = BatchNo.Split('-');

            path.Append("\\" + arr[0]);
            path.Append("\\" + arr[1]);
			if (FolderLevelA!=null)
			{
				path.Append("\\" + FolderLevelA.FolderName);
			}
			if (FolderLevelB != null)
			{
				path.Append("\\" + FolderLevelB.FolderName);
				path.Append("\\" + CheckType.FolderName);
			}
			path.Append("\\" );
			return path.ToString();
		}

		/// <summary>
		/// 获取文件路径 EN
		/// </summary>
		/// <returns></returns>
		public virtual string GetFolerPathEN()
		{
			var path = new StringBuilder();

			//path.Append("/" + ProcessType.FolderName);
			//path.Append("/" + "EEM");

			var arr = BatchNo.Split('-');

			path.Append("\\" + arr[0]);
			path.Append("\\" + arr[1]);
			if (FolderLevelA != null)
			{
				path.Append("\\" + FolderLevelA.FolderNameEN);
			}
			if (FolderLevelB != null)
			{
				path.Append("\\" + FolderLevelB.FolderNameEN);
				path.Append("\\" + CheckType.FolderNameEN);
			}
			path.Append("\\");
			return path.ToString();
		}
	}
}
